home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d6 / glazer.arc / INVYIELD.BAS < prev    next >
BASIC Source File  |  1988-10-07  |  1KB  |  28 lines

  1. 100 'Investment Yield ("INVYIELD")
  2. 110 CLS
  3. 120 COLOR 0,15 : PRINT "Investment Yield" : COLOR 15,0
  4. 130 DEFDBL A-Z
  5. 140 PCTFMT$ = "###.##_%"
  6. 150 PRINT : PRINT
  7. 160 PRINT "Do not enter dollar signs or commas"
  8. 170 PRINT
  9. 180 '     Let user enter data
  10. 190 INPUT "Purchase price of investment: ", PV
  11. 200 INPUT "Value of investment at end of term: ", FV
  12. 210 INPUT "Income per period: ", PMT
  13. 220 INPUT "Total number of periods: ", NPERIODS
  14. 230 INPUT "Number of income receipts per year: ", NPY
  15. 240 INPUT "Annual interest rate (in percent): ", AR
  16. 250 '     Find present value of income receipts
  17. 260 PR = (1 + AR / 100) ^ (1 / NPY) - 1
  18. 270 IF PR <> 0  THEN VALUEINCOME = (PMT / PR) * (1 - (1 + PR) ^ -NPERIODS)                      ELSE VALUEINCOME = NPERIODS * PMT
  19. 280 '     Find total future value
  20. 290 TOTALFV = VALUEINCOME * (1 + PR) ^ NPERIODS + FV
  21. 300 '     Find rate of return per period
  22. 310 PY = (TOTALFV / PV) ^ (1 / NPERIODS) - 1
  23. 320 '     Convert to annual rate of return
  24. 330 AY = 100 * ( (1 + PY) ^ NPY - 1)
  25. 340 PRINT
  26. 350 PRINT "Annual rate of return: "; USING PCTFMT$; AY
  27. 360 END
  28.